<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="../jquery-3.1.0.min.js"></script>
</head>
<body>
<div id="text" style="width: 300px;height:400px;border: 1px blue solid;">

</div>
<input id="btn" type="button" value="点我看命令"/>
<script>
    $(document).ready(function(){
        $("#btn").click(function(){
            $.ajax({
                url:'/L17/jquery课程/wrz_ajax/data.json',
                type:'POST', //GET
                async:true,    //或false,是否异步
                data:{
                    name:'yang',age:25
                },
                dataType:'text',    //返回的数据格式：json/xml/html/script/jsonp/text
                success:function(data,textStatus,jqXHR){
                    $("#text").html(data);
                    console.log(data)
                    console.log(textStatus)
                    console.log(jqXHR)
                },
                error:function(xhr,textStatus){
                    console.log('错误')
                    console.log(xhr)
                    console.log(textStatus)
                },
                complete:function(){
                    console.log('结束')
                }
            })
        });

    });
</script>
</body>
</html>